import QtQuick 2.15
import QtQuick.Controls 2.15
import QtQuick.Shapes 1.15

SubView0{
    id: root
    width: 252
    height: 325
    Component.onCompleted:
    {
        collectAngleTimer.interval=mymodbus.encoderInterval;
        collectAngleTimer.running=true;
    }
    Rectangle
    {
        y:13
        width:252
        height:312
        color:"transparent"
        border.color: "white"
        Rectangle{
            width:252
            height:235
            color:"transparent"
            Text {
                id: angle
                anchors.centerIn: parent
                x: 22
                y: 25
                text: "-.-°"
                color: "white"
                font.pixelSize: 55
            }
        }


        Button
        {
            id:btnStart
            x: 76
            y: 239
            width: 110
            height: 36
            background: Rectangle{
                border.width: 0
                color: "#C070B0"
                    }

            text: qsTr("清零")
            font.pixelSize: 25
            palette.buttonText: "white"
            onClicked: {
if(angleLoader.visible){
    return;
}
angleLoader.visible=true;
var result =mymodbus.slotClearAngle()
angleLoader.visible=false;
            }
        }
    }
    Timer{
        id: collectAngleTimer
        running: false
        repeat: true
        onTriggered: {
            angle.text = mymodbus.angle+"°"
        }
    }
}
